#include<bits/stdc++.h>
using namespace std;
int n,a[100001],ans,x;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++){
        cin>>x;
        a[x]++;
    }
    for(int i=2;i<=100000;i++){
        int d=min(a[i],a[i-1]);
        ans-=d;
        a[i-1]-=d;
        a[i]+=a[i-1];
    }
    cout<<ans;
    return 0;
}
